<script type="text/javascript">    
    $(document).ready(function()
    {        
        $.ajax
        ({
            
            type: "POST", 
            data : {
                opcion: <?php echo $codigo ?>
            },
            url: '<?php echo PUBLIC_PATH; ?>ajax/notificacionesdetalles.php',
            dataType: "json",
            success: function(data)
            {
                if (data != null && data.length > 0)
                {
                    var count = 0;
                    //console.log(data);
                    $(".table-condensed tbody").empty();
                    while (count < data.length)
                    {
                        $(".table-condensed tbody").append("<tr>");
                        $(".table-condensed tbody").append("<td><center>"+data[count]['username_usu']+"</center></td>");
                        $(".table-condensed tbody").append("<td><center>"+data[count]['fecha_sol']+"</center></td>");
                        $(".table-condensed tbody").append("<td><center>"+data[count]['estado_sol']+"</center></td>");
                        $(".table-condensed tbody").append("<td><center>"+data[count]['tipo_sol']+"</center></td>");
                        $(".table-condensed tbody").append("<td><center><a href='/trunk/qualitytours/solicitud/administrar/"+data[count]['id'] +"/"+data[count]['id_usu'] +"/<?php echo $leng; ?>'><button class='btn btn-small btn-info' type='button'>Administrar</button></a></center></td>");
                        $(".table-condensed tbody").prepend("</tr>");
                        count++;
                    }
                }
                else 
                {
                    $(".table-condensed tbody").empty();
                    $(".table-condensed tbody").append('<td><b>NO SE ENCONTRARON RESULTADOS</b></td>');
                }
            } // cierre success
            
            //DESCOMENTAR LA SIGUIENTE LINEA SI QUEREEMOS VER ALERTS SI HAY ERROR EN LA SOLICITUD AJAX
            //,error: function (xhr, ajaxOptions, thrownError){alert(xhr.status+' '+thrownError);}
        });
    });
</script>

<table class="table table-condensed">
    <thead>
        <tr>
            <!-- cabecera de la tabla-->
            <th><center>Username</center></th>
            <th><center><?php echo "Fecha"; ?></center></th>
            <th><center><?php echo "Estado"; ?></center></th>
            <th><center><?php echo "Tipo" ?></center></th>
            <th> </th>
        </tr>
    </thead>
    <tbody>
    </tbody>
</table>